import request from '@/utils/request'

const purchaserApi = {
  // 采购方列表
  getPurchaserList: (params) => {
    return request({
      url: '/member/purchaserAPI/page',
      method: 'GET',
      params
    })
  },
  // 删除采购方
  deletePurchaser: (id) => {
    return request({
      url: `/member/purchaser/delete?id=${id}`,
      method: 'DELETE',
    })
  },
  // 采购方详情
  getPurchaserDetail: (id) => {
    return request({
      url: `/member/purchaserAPI/get?id=${id}`,
      method: 'GET',
    })
  },
  // 更新采购方认证状态
  updatePurchaserStatus: (data) => {
    return request({
      url: "/member/purchaser/update-attestation-state",
      method: 'POST',
      data: data
    })
  },
  // 更新采购方使用状态
  updatePurchaserUseStatus: (data) => {
    return request({
      url: "/member/purchaser/update-use-status",
      method: 'POST',
      data: data
    })
  },
  // 采购方银行信息
  getPurchaserBank: (id) => {
    return request({
      url: `/member/bank/getByCompanyId?companyId=${id}`,
      method: 'GET'
    })
  },
  // 邀约采购方
  invitePurchaser: (data) => {
    return request({
      url: '/member/purchaserAPI/inviteJoin',
      method: 'POST',
      data: data,
      validAdminType: true
    })
  },
  // 修改邀约信息
  updateInviteData: (data) => {
    return request({
      url: '/member/purchaserAPI/updateInviteData',
      method: 'PUT',
      data: data,
      validAdminType: true
    })
  },
  // 获取采购方统计数据
  getStatisticData: (params) => {
    return request({
      url: '/scmReport/cgftjxx',
      method: 'GET',
      params
    })
  }
}
export default purchaserApi